﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BIS.Utility.DAL.DataMapper;
using BIS.Utility.Converter;

namespace BIS.Portal.Modules.CMS.Entity
{
    public class AdminCmsArticleInCategoryEntity : IEntity
    {
        #region Member
        private int article_in_category;
        private int article_id;
        private int category_id;
        private int article_priority;
        private int is_primary_category;
        #endregion

        #region Properties

        public int Article_in_category
        {
            get { return article_in_category; }
            set { article_in_category = value; }
        }

        public int Article_id
        {
            get { return article_id; }
            set { article_id = value; }
        }

        public int Category_id
        {
            get { return category_id; }
            set { category_id = value; }
        }

        public int Article_priority
        {
            get { return article_priority; }
            set { article_priority = value; }
        }

        public int Is_primary_category
        {
            get { return is_primary_category; }
            set { is_primary_category = value; }
        }
        #endregion

        #region Constructor
        public AdminCmsArticleInCategoryEntity()
        {
        }

        public AdminCmsArticleInCategoryEntity(int articleId, int categoryId, int articlePriority, int isPrimaryCategory, int articleInCategory)
        {
            article_id = articleId;
            category_id = categoryId;
            article_priority = articlePriority;
            is_primary_category = isPrimaryCategory;
            article_in_category = articleInCategory;
        }
        #endregion

        #region Fill
        public void Fill(System.Data.IDataReader reader)
        {
            Article_id = Functions.GetInt(reader["article_id"]);
            Category_id = Functions.GetInt(reader["category_id"]);
            Article_priority = Functions.GetInt(reader["article_priority"]);
            Is_primary_category = Functions.GetInt(reader["is_primary_category"]);
            Article_in_category = Functions.GetInt(reader["Article_in_category"]);
        }

        #endregion
    }
}
